﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" AutoEventWireup="true" CodeBehind="Roles.aspx.cs" Inherits="App.Web.Views.App.Account.AccountAdmin.Roles" %>
<%@ Import Namespace="App.Utility.Paging" %>
<%@ Import Namespace="App.Account.Models" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <% PageResponse<Role> Roles = (PageResponse<Role>)ViewData.Model;
       PagingSet Paging = (PagingSet)ViewData["PagingSet"]; %>
        <h2>
        Edit Users</h2>
    <h3>
        <%= Html.ActionLink<App.Account.Controllers.AccountAdminController>(c=>c.Index(),"<< Return to Account Admin") %></h3>
    <fieldset>
        <legend>Roles</legend>
        Filter Results :  <%= Html.FilterInput(Paging, "Go") %><br class="clear" />
        <% if (Roles.Page.Count > 0)
           { %><table><thead><tr><th></th><th></th><th><%= Html.PageSorting(Paging, "Name","Name")%></th><th><%= Html.PageSorting(Paging, "Level", "Level")%></th></tr></thead><tbody>
           <% foreach (Role role in Roles.Page)
              { %>
           <tr> <td><%= Html.ActionLink<App.Account.Controllers.AccountAdminController>(c => c.EditRole(role.ID), "edit")%></td>
                <td><%= Html.ActionLink<App.Account.Controllers.AccountAdminController>(c => c.DeleteRoleWithPage(Roles.PageIndex + 1, role.ID), "delete", new { onclick = "return confirm('Are you sure you wish to delete this item?');" })%></td><td><%= role.Name %></td><td><%= role.Level %></td></tr>
           <%} %></tbody></table><br />
        <%= Html.PageListing(Roles, 5, "page")%> <br class="clear" /><%= Html.ActionLink<App.Account.Controllers.AccountAdminController>(c=>c.EditRole(null),"Create A New Item") %>
        <% }
           else
           { %>
        <div>
            No items...</div>
        <%} %>
    </fieldset>
</asp:Content>
